#ifndef ATTRIBUTE_PROXY_H_
#define ATTRIBUTE_PROXY_H_

#include <string>
#include <type_traits>
#include <algorithm>
#include <cstring>
#include <unicode/unistr.h>
#include "fileDefine.h"

#define GetFileHeadAttribute(attrName,FileHeadObject) GetFileHeadAttributeValue(FileHeadObject.##attrName)
#define SetFileHeadAttribute(attrName,FileHeadObject) SetFileHeadAttributeValue(FileHeadObject.##attrName)

template<class T>
T GetFileHeadAttributeValue(T& value)
{
  static_assert(!std::is_same<T,char16_t[]>::value,"不支持字符串调用");
  return value;
}

std::string GetFileHeadAttributeValue(char16_t* str,long strLength);

template<class T>
void SetFileHeadAttributeValue(T& value,const T& newValue)
{
  static_assert(!std::is_same<T,char16_t[]>::value,"不支持字符串调用");
  value=newValue;
}

//strLength不算空字符
void SetFileHeadAttributeValue(char16_t* str,long strLength,const std::string& newValue);

#endif
